package com.telecomyt.jwportal.activity.conversation;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.flyco.tablayout.SlidingTabLayout;
import com.telecomyt.jwportal.R;
import com.telecomyt.jwportal.activity.conversation.fragment.ConversationStatusFragment;
import com.telecomyt.jwportal.base.BaseActivity;
import com.telecomyt.jwportal.base.BasePresenter;
import com.telecomyt.jwportal.widget.FraToolBar;

import java.util.ArrayList;

import butterknife.BindView;

/**
 * @date: 2020/9/9
 * @author: chengDa
 * @description: 会话列表
 */
public class ConversationListActivity extends BaseActivity {
    @BindView(R.id.mFraToolBar)
    FraToolBar mFraToolBar;
    @BindView(R.id.mTabLayout)
    SlidingTabLayout mTabLayout;
    @BindView(R.id.mViewPager)
    ViewPager mViewPager;
    private String[] mTitles = {"通话", "视频", "音频"};
    private ArrayList<Fragment> mFragments = new ArrayList<>();
    private ConversationStatusFragment conversationStatusFragment;

    public static void start(Context context) {
        Intent starter = new Intent(context, ConversationListActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_conver_sation_list;
    }

    @Override
    protected void initView() {
        mFraToolBar.setLeftFinish(this);
    }

    @Override
    protected void initData() {
        for (int i = 0; i < mTitles.length; i++) {
            conversationStatusFragment = new ConversationStatusFragment();
            Bundle bundle = new Bundle();
            bundle.putInt("position", i);
            conversationStatusFragment.setArguments(bundle);
            mFragments.add(conversationStatusFragment);
        }
        mTabLayout.setViewPager(mViewPager, mTitles, this, mFragments);
    }

    @Override
    protected BasePresenter creatPresenter() {
        return null;
    }


}